<?php
function smarty_function_U($query, $template)
{
	global $config;	
	$url_str  = '';
	if(empty($query)) $query = array();	
	if(!is_array($query)){
		$temp  = explode('&', $query);
		$query = array(); 
		foreach($temp as $v){
			$v = explode('=', $v);
			$query[$v[0]] = $v[1];
		}
	}	
	if($config['url_mode'] == 'pathinfo'){
		foreach($query as $k=>$v){
			if($k == 'c' || $k == 'a') continue;
			$url_str .= $k.'/'.$v.'/';
		}		
		$url = "/index.php/".$query['c']."/".$query['a']."/".$url_str;
	}
	else{		
		$url_str = http_build_query($query);
		$url = "/index.php?".$url_str;
	}
	
	return $url;
}
?>